import { useRoutes } from 'react-router-dom'
import React from 'react'
import Home from './Home'
import School from './school/School'
import List from './school/SchoolList'
import InterActive from './interactive/index'
import AbsentList from './interactive/studentAbsent/AbsentList'
import AbsentAudit from './interactive/studentAbsent/AbsentAudit'
import AbsentRecord from './interactive/studentAbsent/AbsentRecord'
import AbsentSetting from './interactive/studentAbsent/AbsentSetting'
import VoteManage from './interactive/vote/VoteManage'
import VoteInput from './interactive/vote/VoteInput'
import Album from './interactive/Photo/Album'
import Audit from './interactive/Photo/Audit'
import Install from './interactive/Photo/Install'
import Estimate from './interactive/Estimate/Estimate'
import Power from './interactive/Estimate/Power'
import Call from './interactive/Attendance/Call'
import Attendance from './interactive/Attendance/Attendance'
import Review from './interactive/Estimate/Review'
import MyAlbum from './interactive/Photo/MyAlbum'
import Publish from './interactive/Photo/Publish'
import Clocking from './interactive/Attendance/Clocking'
import Interactives from './interactive/VotingManagement'
import InformRegulate from './interactive/informRegulate'
import InformRegulateCon from './interactive/informRegulateCon'
import Tz from './interactive/notification'
import Addnotice from './notice/Addnotice'
import Index from './notice/Index'
import User from './user/User';
import Al from './user/AllList';
import StudentList from './user/StudentList';
import TeacherList from './user/TeacherList';
import ParentsList from './user/parentsList';
// import ParentsList from './user';


let routes = [
    { path: '/', element: <Home /> },
    { path: '/home', element: <Home /> },
    {
        path: '/school',
        element: <School />,
        children: [
            {
                path: 'list',
                element: <List />,
            },
        ],
    },
    {
        //家校互动
        path: '/interactive',
        element: <InterActive />,
        children: [
            {
                //学生请假
                path: 'studentAbsent',
                // element: <AbsentAudit />,
                children: [
                    {
                        path: 'absentList',
                        element: <AbsentList />,
                    },
                    {
                        path: 'absentAudit',
                        element: <AbsentAudit />,
                    },
                    {
                        path: 'absentRecord',
                        element: <AbsentRecord />,
                    },
                    {
                        path: 'absentSetting',
                        element: <AbsentSetting />,
                    }, 
                ],
            },

            //相册管理
            {
                path: 'Photo',
                children: [
                    {
                        path: 'Album',
                        tile: '相册列表',
                        element: <Album />,
                    },
                    {
                        path: 'Audit',
                        tile: '审核列表',
                        element: <Audit />,
                    },
                    {
                        path: 'Install',
                        tile: '审核设置',
                        element: <Install />,
                    },
                ],
            },
            //评价管理
            {
                path: 'Estimate',
                children: [
                    {
                        path: 'Estimate',
                        tile: '评价列表',
                        element: <Estimate />,
                    },
                    {
                        path: 'Power',
                        tile: '评价权限设置',
                        element: <Power />,
                    },
                ],
            },
            //出勤确认
            {
                path: 'Attendance',
                children: [
                    {
                        path: 'Call',
                        tile: '今日点名',
                        element: <Call />,
                    },
                    {
                        path: 'Attendance',
                        tile: '出勤统计',
                        element: <Attendance />,
                    },
                ],
            },
            {
                path: 'voteManage',
                element: <VoteManage />,
            },
            // 通知列表
            { path: 'interactives', element: <InformRegulate /> },
            { path: 'informRegulateCon', element: <InformRegulateCon /> },
            // 通知类型管理
            { path: 'tz', element: <Tz /> },
            // 健康中心
            { path: 'jk', element: <Interactives /> },
        ],
    },
    {
        path: '/notice', element: <Index />,
    },
    { path: "addnotice", element: <Addnotice /> },
    //发布评语
    {
        path: 'Review',
        tile: '发布评语',
        element: <Review />,
    },
    //我的相册
    {
        path: 'MyAlbum',
        tile: '我的相册',
        element: <MyAlbum />,
    },
    //发布相册页面
    {
        path: 'Publish',
        tile: '发布相册',
        element: <Publish />,
    },
    //考勤确认
    {
        path: 'Clocking',
        tile: '考勤确认',
        element: <Clocking />,
    },
    //
    {
        path: '/voteInput',
        element: <VoteInput />,
    },
    {
        // 用户统计
        path: '/user',
        element: <User />,
        children: [
            // 用户概况
            {
                path: 'al',
                element: <Al />,
            },
            // 学生列表
            {
                path: 'studentList',
                element: <StudentList />,
            },
            // 老师列表
            {
                path: 'teacherList',
                element: <TeacherList />,
            },
            // 家长列表
            {
                path: 'parentsList',
                element: <ParentsList />,
            },
        ]
    },
]

const route = () => {
    return useRoutes(routes)
}

export default route
